package router

import (
	"fmt"
	"github.com/gin-gonic/gin"
	"micros/api/handler"
	"micros/middleware"
)

func Router(c *gin.Engine) {
	UserApi := c.Group("/api/user")
	FriendApi := c.Group("/api/friend")
	ChatApi := c.Group("/api/chat")
	MomentApi := c.Group("/api/moments")

	c.POST("/sms", handler.SendSms)
	c.POST("/register", handler.Register)
	c.POST("/login", handler.Login)
	c.GET("/show", handler.FriendShow)
	c.POST("/add", handler.AddFriend)
	c.GET("/list", handler.FriendList)
	c.POST("/black", handler.AddBlack)
	c.GET("/blacklist", handler.BlackList)
	c.GET("/moments", handler.MomentList)
	c.GET("/chat", handler.Chat)
	c.POST("/moment", handler.Moment)
	c.POST("/like", handler.Like)
	c.GET("/get", handler.Show)
	c.Group("/api", middleware.JWTPare())
	fmt.Println(UserApi, FriendApi, ChatApi, MomentApi)
}
